/* Make the Key Balance Tables */

clear all

cd "C:\Users\valen909\Dropbox\Hoover\America1Room\Climate\data\Full_With_FollowUp"

/* This Sample only has data from control and treament group members
who answer survey questions at T1, T2, AND T3 */
use climate_data_foranalyses_27items.dta

/* Change to output directory */
cd "C:\Users\valen909\Dropbox\Hoover\America1Room\Climate\output\for_paper\27item_PBS"

label var hs_or_less "Less Than HS/HS"
label var college_grad "Some College or Above"
label var male "Male"
label var over60 "Over 60"
label var white "White"
label var married "Married"
label var employed "Employed"
label var lowinc "HH Inc. <$30,000"
label var home_owner "Home Owner"
label var rural "From Non-Metro"

/* Party Affiliation at Time 1 */
label var democrat_t1 "Share Democrats"
label var republican_t1 "Share Republicans"
label var independent_t1 "Share Independents"
label var lean_democrat "Share Democrat & Lean Democrat"
label var lean_republican "Share Republican & Lean Republican"

label var ideology_score1 "Policy-Based Score, T1"
label var ideology_score2 "Policy-Based Score, T2"
label var ideology_score3 "Policy-Based Score, T3"
label var definitely_vote3 "Intended to vote, T3"

/* The Sample we are working with throughout the analyses is the sample of those people who
take the Time 1, Time 2, AND Time 3 surveys */  
eststo delegate: estpost summarize college_grad male over60 white married employed lowinc home_owner rural lean_democrat lean_republican ideology_score1 ideology_score2 ideology_score3 definitely_vote3 if delegate==1 
eststo control: estpost summarize college_grad male over60 white married employed lowinc home_owner rural lean_democrat lean_republican ideology_score1 ideology_score2 ideology_score3 definitely_vote3 if delegate==0
	
eststo groupdiff: estpost ttest college_grad male over60 white married employed lowinc home_owner rural lean_democrat lean_republican ideology_score1 ideology_score2 ideology_score3 definitely_vote3, by(delegate)
esttab delegate control groupdiff using balancetable.rtf, replace star(* 0.10 ** 0.05 *** 0.01) cell("mean(label() pattern(1 1 0 0) fmt(2)) b(star label(Diff.) pattern(0 0 1 0) fmt(2)) t(pattern(0 0 1 0) fmt(2))") mtitle("Participant Group" "Control Group" "Difference (2)-(1)" "T-Stat") label legend nogaps compress
